package com.thunisoft.incremental.dao;

import com.thunisoft.incremental.common.model.Task;
import com.thunisoft.incremental.common.model.TaskExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface TaskMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @SelectProvider(type=TaskSqlProvider.class, method="countByExample")
    int countByExample(TaskExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @DeleteProvider(type=TaskSqlProvider.class, method="deleteByExample")
    int deleteByExample(TaskExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @Delete({
        "delete from copy_from.t_task",
        "where c_id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @Insert({
        "insert into copy_from.t_task (c_id, c_name, ",
        "c_viewname, c_tablename, ",
        "c_datasource_from, c_group_id, ",
        "dt_createtime, dt_updatetime, ",
        "c_datasource_to)",
        "values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{viewname,jdbcType=VARCHAR}, #{tablename,jdbcType=VARCHAR}, ",
        "#{datasourceFrom,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, ",
        "#{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, ",
        "#{datasourceTo,jdbcType=VARCHAR})"
    })
    int insert(Task record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @InsertProvider(type=TaskSqlProvider.class, method="insertSelective")
    int insertSelective(Task record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @SelectProvider(type=TaskSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="c_id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="c_name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_viewname", property="viewname", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_tablename", property="tablename", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_datasource_from", property="datasourceFrom", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_group_id", property="groupId", jdbcType=JdbcType.VARCHAR),
        @Result(column="dt_createtime", property="createtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="dt_updatetime", property="updatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="c_datasource_to", property="datasourceTo", jdbcType=JdbcType.VARCHAR)
    })
    List<Task> selectByExample(TaskExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @Select({
        "select",
        "c_id, c_name, c_viewname, c_tablename, c_datasource_from, c_group_id, dt_createtime, ",
        "dt_updatetime, c_datasource_to",
        "from copy_from.t_task",
        "where c_id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="c_id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="c_name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_viewname", property="viewname", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_tablename", property="tablename", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_datasource_from", property="datasourceFrom", jdbcType=JdbcType.VARCHAR),
        @Result(column="c_group_id", property="groupId", jdbcType=JdbcType.VARCHAR),
        @Result(column="dt_createtime", property="createtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="dt_updatetime", property="updatetime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="c_datasource_to", property="datasourceTo", jdbcType=JdbcType.VARCHAR)
    })
    Task selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @UpdateProvider(type=TaskSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Task record, @Param("example") TaskExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @UpdateProvider(type=TaskSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Task record, @Param("example") TaskExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @UpdateProvider(type=TaskSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Task record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table copy_from.t_task
     *
     * @mbggenerated Wed Apr 01 17:51:43 CST 2020
     */
    @Update({
        "update copy_from.t_task",
        "set c_name = #{name,jdbcType=VARCHAR},",
          "c_viewname = #{viewname,jdbcType=VARCHAR},",
          "c_tablename = #{tablename,jdbcType=VARCHAR},",
          "c_datasource_from = #{datasourceFrom,jdbcType=VARCHAR},",
          "c_group_id = #{groupId,jdbcType=VARCHAR},",
          "dt_createtime = #{createtime,jdbcType=TIMESTAMP},",
          "dt_updatetime = #{updatetime,jdbcType=TIMESTAMP},",
          "c_datasource_to = #{datasourceTo,jdbcType=VARCHAR}",
        "where c_id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(Task record);
}